package com.esri.core.portal;

import com.esri.core.map.FeatureSet;
import org.achartengine.internal.a;
import org.codehaus.jackson.JsonParser;
import org.codehaus.jackson.JsonToken;
import org.codehaus.jackson.map.ObjectMapper;

/* loaded from: classes.dex */
public class WebMapSubLayer {
    String a;
    FeatureSet b;
    String d;
    WebMapPopupInfo e;
    String g;
    String h;
    String i;
    int c = -1;
    boolean f = false;
    boolean j = false;

    public String getTitle() {
        return this.g;
    }

    public void setTitle(String str) {
        this.g = str;
    }

    public String getName() {
        return this.h;
    }

    public void setName(String str) {
        this.h = str;
    }

    public String getLayerDefinition() {
        return this.a;
    }

    public FeatureSet getFeatureSet() {
        return this.b;
    }

    public int getLayerId() {
        return this.c;
    }

    public String getLayerURL() {
        return this.d;
    }

    public WebMapPopupInfo getWebMapPopupInfo() {
        return this.e;
    }

    public boolean isShowLegend() {
        return this.f;
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public boolean a() {
        return this.j;
    }

    public String getLegendURL() {
        return this.i;
    }

    private WebMapSubLayer() {
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public static WebMapSubLayer a(JsonParser jsonParser) throws Exception {
        if (jsonParser == null || jsonParser.getCurrentToken() != JsonToken.START_OBJECT) {
            return null;
        }
        WebMapSubLayer webMapSubLayer = new WebMapSubLayer();
        while (jsonParser.nextToken() != JsonToken.END_OBJECT) {
            String currentName = jsonParser.getCurrentName();
            jsonParser.nextToken();
            if ("id".equals(currentName) && jsonParser.getCurrentToken() == JsonToken.VALUE_NUMBER_INT) {
                webMapSubLayer.c = jsonParser.getIntValue();
            } else if ("layerUrl".equals(currentName)) {
                webMapSubLayer.d = jsonParser.getText();
            } else if ("popupInfo".equals(currentName)) {
                webMapSubLayer.e = WebMapPopupInfo.fromJson(jsonParser);
            } else if ("featureSet".equals(currentName)) {
                webMapSubLayer.b = FeatureSet.fromJson(jsonParser, true);
            } else if ("layerDefinition".equals(currentName)) {
                webMapSubLayer.a = new ObjectMapper().readTree(jsonParser).toString();
            } else if ("showLegend".equals(currentName)) {
                webMapSubLayer.f = jsonParser.getBooleanValue();
                webMapSubLayer.j = true;
            } else if (a.b.equals(currentName)) {
                webMapSubLayer.g = jsonParser.getText();
            } else if ("name".equals(currentName)) {
                webMapSubLayer.h = jsonParser.getText();
            } else if ("legendURL".equals(currentName)) {
                webMapSubLayer.i = jsonParser.getText();
            } else {
                jsonParser.skipChildren();
            }
        }
        return webMapSubLayer;
    }
}
